public class Ex5_28{
	public static void main(String[] args){
		long s = 2;
		for (int p = 2; p <= 31; p++){
			s *= 2;
			long k = s - 1;
			if (isPrime(k))
				System.out.println(p + "\t\t" + k);
		}
	}

	public static boolean isPrime(long number){
		boolean yes = true;
		for (long i = 2; i <= (long)Math.sqrt(number); i++){
			if (number % i == 0){
				yes = false;
				break;
			}
		}
		return yes;
	}
}
